﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace OnlineStore
{
    public interface IProductService
    {
        IQueryable<Product> GetAll();
    }

    public class ProductService : IProductService
    {
        private readonly IEntityRepository<Product> productRepo;

        public ProductService() : this(new EntityRepository<Product>()) { }

        public ProductService(IEntityRepository<Product> repository)
        {
            productRepo = repository;
        }

        public IQueryable<Product> GetAll()
        {
            return productRepo.GetAll();
        }
    }
}